package JD_NEXT;

import java.util.Iterator;
import java.util.Set;

public class Example_01 {
    public boolean intersects(Set setA, Set setB) {
        for (final Iterator iteratorA = setA.iterator(); iteratorA.hasNext();) {
            final Object a = iteratorA.next();
            for (final Iterator iteratorB = setB.iterator(); iteratorB.hasNext();) {
                Object b = iteratorA.next();
                if (a.equals(b)) {
                    return true;
                }
            }
        }
        return false;
    }
}
